/* -*- C++ -*- vim: set syntax=cpp:
 * (C) 2005-2010 Frank-Rene Schaefer
 * ABSOLUTELY NO WARRANTY              */
#ifndef __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING
#define __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING

#include <quex/code_base/definitions>

QUEX_NAMESPACE_MAIN_OPEN

/* Read Access */
QUEX_INLINE QUEX_NAME(Mode)*   QUEX_NAME(mode)(QUEX_TYPE_ANALYZER* me);
QUEX_INLINE int                QUEX_NAME(mode_id)(QUEX_TYPE_ANALYZER* me);
QUEX_INLINE const char*        QUEX_NAME(mode_name)(QUEX_TYPE_ANALYZER* me);

/* Map: mode id to mode and vice versa */
QUEX_INLINE QUEX_NAME(Mode)*   QUEX_NAME(map_mode_id_to_mode)(QUEX_TYPE_ANALYZER*  me,
                                                              const int            ModeID);       
QUEX_INLINE int                QUEX_NAME(map_mode_to_mode_id)(const QUEX_TYPE_ANALYZER* me,
                                                              const QUEX_NAME(Mode)*    Mode);

/* Changing Modes */
QUEX_INLINE void        QUEX_NAME(set_mode_brutally_by_id)(QUEX_TYPE_ANALYZER*    me,
                                                           const int              LexerMode);
QUEX_INLINE void        QUEX_NAME(set_mode_brutally)(QUEX_TYPE_ANALYZER* me,
                                                     QUEX_NAME(Mode)*    Mode);
QUEX_INLINE void        QUEX_NAME(enter_mode)(QUEX_TYPE_ANALYZER* me,
                                              /* NOT const*/ QUEX_NAME(Mode)* TargetMode);

/* Changing Modes with stack */ 
QUEX_INLINE void        QUEX_NAME(pop_mode)(QUEX_TYPE_ANALYZER* me);
QUEX_INLINE void        QUEX_NAME(pop_drop_mode)(QUEX_TYPE_ANALYZER* me);
QUEX_INLINE void        QUEX_NAME(push_mode)(QUEX_TYPE_ANALYZER* me, QUEX_NAME(Mode)* new_mode);
  
QUEX_NAMESPACE_MAIN_CLOSE

#endif /* __QUEX_INCLUDE_GUARD__ANALYZER__MEMBER__MODE_HANDLING */

